home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 February / Macworld (1999-02).dmg / Games World / Hot Demos! / DroidWorks demo / dwCD.gob / mission_cog_item_bacta.cog < prev    next >
Text File  |  1998-09-17  |  1KB  |  45 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # POW_BACTA.COG
  4. #
  5. # POWERUP Script - Bacta tank
  6. #
  7. # [YB & CYW]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10.                                                                  
  11.  
  12. symbols
  13.  
  14. thing       powerup                          local
  15. thing       player                           local
  16. int         bin=15                           local
  17. flex        amount                           local
  18.  
  19. message     activate
  20. message     taken
  21.  
  22. sound     powerupSound=NRGpowerup.wav             local
  23.  
  24. end
  25.  
  26. # ========================================================================================
  27.  
  28. code
  29.  
  30. taken:
  31.      player = getlocalplayerthing();
  32.      amount = GetInv(player, bin);
  33.      powerup = GetSenderRef();
  34.      print("got a health powerup");
  35.      if (amount < GetInvMax(player, bin))
  36.      {
  37.           dwflashinventory();
  38.           playsoundlocal(powerupSound, 1.0, 0.0, 0);
  39.           dwplaycammyspeech(0, "ghca004.wav", 0.1, 1);
  40.           destroything(powerup);
  41.           SetInvAvailable(player,bin,1);  
  42.           ChangeInv(player, bin, 1);
  43.      }
  44.      return;
  45.